<?php 
require_once('librarie/lib.class.php');
include('config.php');

new connectDB($adres,$username,$password);
//Создание базы данных.
class basecreate
{
	private $query;
	private $result;
	
	function __construct()
	{
		$query = "CREATE DATABASE IF NOT EXISTS gb CHARACTER SET 'utf8'";
		$this->query = $query;
		$result = mysql_query($this->query);
		$this->result = $result;
	}
	function create()
	{
		$this->query;
		$this->result;
	}
}
	
	
//Создание таблицы сообщений.	
	class  tablemess
	{
		private $query;
		private $result;
		
		function __construct()
		{
			$query = "CREATE TABLE IF NOT EXISTS gb_messages(
    id	 int(255)	    not null auto_increment primary key,
    name varchar(30)	not null,
    mess text			not null)";	
			$this->query = $query;
			$result = mysql_query($query);
			$this->result = $result;
		}
		function createtabmess()
		{
			$this->query;
			$this->result;
		}
	}
	
	
//Создание таблицы комментариев.	
	class  tablecomm
	{
		private $query;
		private $result;
		
		function __construct()
		{
			$query="CREATE TABLE IF NOT EXISTS gb_comments(			
    mess_id	    int(255)	 not null,
    comment text)";
			$this->query = $query;
			$result = mysql_query($query) || die(mysql_error());
			$this->result = $result;
		}
		function createtabmess()
		{
			$this->query;
			$this->result;
		}
	}





?>